<!DOCTYPE html>
<#assign dicSelect = JspTaglibs["http://www.casic304.cn/dicSelect"]/>
<#assign f = JspTaglibs["http://www.casic304.cn/f"] />
<#assign SourceDept = JspTaglibs["http://www.casic304.cn/SourceDept"]/>
<head>
    <meta charset="utf-8">
    <title>课题信息列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
</head>
<body class="listBody">
<div class="qbdms-list">
    <div class="layui-table-view-body">
        <table id="wQbdTecBasicmanageTable" lay-filter="wQbdTecBasicmanageTable"></table>
    </div>
</div>
<!-- 列表头部工具栏 -->
<script type="text/html" id="wQbdTecBasicmanageHeaderToolsBar">
    <div class="ccpui-enterSel">
        <div class="layui-btn-container">
            <@f.a alias="xzan_ktxx2,xzan_ktxx3" css="layui-btn layui-btn-sm fillBtn" event="add">
                <span>新增</span>
            </@f.a>
            <@f.a alias="scan_ktxx2,scan_ktxx3" css="layui-btn layui-btn-sm" event="delete">
                <span>删除</span>
            </@f.a>
            <a class="layui-btn layui-btn-sm" lay-event="export">
                <span>导出</span>
            </a>
             <@f.a alias="dran_ktxx2,dran_ktxx3" css="layui-btn layui-btn-sm" event="import">
                <span>导入</span>
            </@f.a>

            <@f.a alias="sban_ktxx2,sban_ktxx3" event="report" css="layui-btn layui-btn-sm" >
                <span>上报</span>
            </@f.a>
            <a class="layui-btn layui-btn-sm" lay-event="listStyle">
                <span>配置列</span>
            </a>

    </div>
    <form class="layui-form" action="" lay-filter="wQbdTecBasicmanageQueryForm">
        <div class="layui-form-body selch">
            <div class="table-top-filter layui-row">
                <@SourceDept.dept css="layui-input filter-value "/>
                <div class="qbdms-listForm">
                    <label class="layui-form-label">项目编号</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input filter-value" name="Q_fItemnumber_SL" placeholder="请输入"/>
                    </div>
                </div>

                <div class=" qbdms-listForm">
                    <label class="layui-form-label">项目名称</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input filter-value" name="Q_fItemname_SL" placeholder="请输入"/>
                    </div>
                </div>

                <div class=" qbdms-listForm">
                    <label class="layui-form-label">课题类型</label>
                    <div class="layui-input-block">
                        <@dicSelect.dic name="Q_fTopictype_S" css="layui-input filter-value" search=true nodeKey="ktlx" />
                    </div>
                </div>
                <div class=" qbdms-listForm">
                    <label class="layui-form-label">课题类别</label>
                    <div class="layui-input-block">
                        <@dicSelect.dic name="Q_fItemtype_S" css="layui-input filter-value" search=true nodeKey="ktlb" />
                    </div>
                </div>

                <div class=" qbdms-listForm">
                    <label class="layui-form-label">技术领域</label>
                    <div class="layui-input-block">
                        <@dicSelect.dic name="Q_fClassification_S" css="layui-input filter-value" search=true nodeKey="jzly" />
                    </div>
                </div>

                <div class=" qbdms-listForm">
                    <label class="layui-form-label">批复年度</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input filter-value" readonly="readonly" name="Q_fApprovedyear_S" id="pfnd" placeholder="请输入"/>
                    </div>
                </div>

                <div class=" qbdms-listForm">
                    <label class="layui-form-label">主承担单位</label>
                    <div class="layui-input-block">
                        <select name="Q_fMainunitid_S" class="layui-input filter-value" lay-search="" ></select>
                    </div>
                </div>
            </div>
            <div class="selchBtn">
                <a class="layui-btn layui-btn-sm fillBtn" lay-event="query">
                    <span>查询</span>
                </a>
                <div class="layui-btn-group">
                    <button type="button" class="layui-btn layui-btn-sm" lay-event="clears" style="width: 28px;font-size: 12px;padding: 0">
                        <i class="iconfont data-iconcommon_refresh"></i>
                    </button>
                    <button type="button" class="layui-btn layui-btn-sm screenParent" lay-event="screen" style="width: 28px;font-size: 12px;padding: 0">
                        <i class="iconfont data-iconcommon_downarrow screen"></i>
                    </button>
                </div>
            </div>
        </div>
    </form>
    </div>

</script>
<!-- 右侧工具栏 -->
<script type="text/html" id="wQbdTecBasicmanageRightToolsBar">
    {{# if(d.createBy === '${userId}' &&  d.allowEdit){ }}
    <@f.a alias="xgan_ktxx2,xgan_ktxx3" css="RightBtn" event="edit">编辑</@f.a>
    {{#  } }}
    <a  class="RightBtn" lay-event="particulars">详情</a>
    {{# if(d.createBy === '${userId}' && d.allowDel){ }}
    <@f.a alias="scan_ktxx2,scan_ktxx3" css="RightBtn" event="del">删除</@f.a>
    {{#  } }}
    <a class="RightBtn" lay-event="psh"> 评审会</a>
</script>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    //一般直接写在一个js文件中
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','table', 'form', 'common','publicMethods','jquery','laydate', 'layer','propsHandle'], function () {
        var laydate = layui.laydate;
        var table = layui.table;
        var form = layui.form;
        var common = layui.common;
        var publicMethods = layui.publicMethods;
        var $ = layui.jquery;
        var layer = layui.layer;
        var propsHandle = layui.propsHandle;
        var defProps = {
            //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
            viewMould: 'moulds/', // 组件模块 存放文件 *****
            selectorBtn: '.selectorBtn'
        },
        temQuery = new propsHandle();  // 实例化模板功能部分
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });
        common.tableSort('wQbdTecBasicmanageTable');

        var tableH=publicMethods.tabHeight();

        var cols = '${cols}';
        var currentSystemLevel = "${currentSystemLevel}";

        var orderCols = [{type: 'checkbox', fixed: 'left'},{field: 'sn', type: 'numbers', title: '序号', fixed: 'left'}];

        var fillDeptCols = [];
        if ("GROUPLEVEL" === currentSystemLevel) {
            fillDeptCols = [{field: 'filldeptHospital', title: '数据来源单位', sort: true, sortname: 'filldepthospital',minWidth:'150'}];
        } else if ("HOSPITALLEVEL" === currentSystemLevel) {
            fillDeptCols = [{field: 'filldept', title: '数据来源单位', sort: true, sortname: 'filldept',minWidth:'150'}];
        } else if ("PLANTLEVEL" === currentSystemLevel) {
            fillDeptCols = [{field: 'filldept', title: '数据来源单位', sort: true, sortname: 'filldept',minWidth:'150'}];
        }

        var commonCols = [
            //表头
            // {field: 'sn', type: 'numbers', title: '序号', fixed: 'left'}
            // ,{type: 'checkbox', fixed: 'left'}
            // ,{field: 'id', title: '主键',sort:false, sortname: 'id'}9
            // ,{field: 'fFillman', title: '填写人',sort:false, sortname: 'f_fillman'}
            // ,{field: 'fFillmanaccount', title: '填写人的账号',sort:false, sortname: 'f_fillmanaccount'}
            // {field: 'filldept', title: '数据来源单位',sort:false, sortname: 'filldept'}
            {field: 'fItemname', title: '项目名称',sort:false, sortname: 'f_itemname',minWidth: '160'}
            ,{field: 'fApprovedyear', title: '批复年度',sort:false, sortname: 'f_approvedyear',minWidth: '140'}
            ,{field: 'fMainunit', title: '主承担单位',sort:false, sortname: 'f_mainunit',minWidth: '160'}
            ,{field: 'fItemnumber', title: '项目编号',sort:false, sortname: 'f_itemnumber',minWidth: '150'}
            ,{field: 'fTopictype', title: '课题类型',sort:false, sortname: 'f_topictype',minWidth: '150'}
            ,{field: 'fItemtype', title: '课题类别',sort:false, sortname: 'f_itemtype',minWidth: '150'}
            ,{field: 'fClassification', title: '技术领域',sort:false, sortname: 'f_classification',minWidth: '140'}
            ,{field: 'fApprovalmoney', title: '批复总经费',sort:false, sortname: 'f_approvalmoney',minWidth: '160'}
        ];
        var hideCols = [
            // ,{field: 'fFilldeptid', title: '填写部门id',sort:false, sortname: 'f_filldeptid'}
            // ,{field: 'fFilldepthospital', title: '二级部门名称',sort:false, sortname: 'f_filldepthospital'}
            // ,{field: 'fFilldepthospitalid', title: '二级部门id',sort:false, sortname: 'f_filldepthospitalid'}
            // ,{field: 'fFilldate', title: '填写日期',sort:false, sortname: 'f_filldate'}
            {field: 'secret', title: '项目密级',sort:false, sortname: 'secret',hide: true,minWidth: '140'}
            ,{field: 'fItemdeptaddress', title: '项目单位地址',sort:false, sortname: 'f_itemdeptaddress', hide: true,minWidth: '160'}
            ,{field: 'fTestmodel', title: '拟试点型号',sort:false, sortname: 'f_testmodel', hide: true,minWidth: '160'}
            //如需转换为:yyyy-MM-dd HH:mm:ss: return publicMethods.timeData(d.fItemstartdate,"1");
            //如需转换为HH:mm:ss: return publicMethods.timeData(d.fItemstartdate,"2");
            // 当前转换后的格式为yyyy-MM-dd: return publicMethods.timeData(d.fItemstartdate);
            ,{field: 'fItemstartdate', title: '项目起始时间',sort:false, sortname: 'f_itemstartdate', hide: true,minWidth: '160'
                // ,templet: function (d) {
                // return publicMethods.timeData(d.fItemstartdate);}
            }
            //如需转换为:yyyy-MM-dd HH:mm:ss: return publicMethods.timeData(d.fItemenddate,"1");
            //如需转换为HH:mm:ss: return publicMethods.timeData(d.fItemenddate,"2");
            // 当前转换后的格式为yyyy-MM-dd: return publicMethods.timeData(d.fItemenddate);
            // ,{field: 'fItemenddate', title: '项目结束时间',sort:false, sortname: 'f_itemenddate',templet: function (d) {
            //     return publicMethods.timeData(d.fItemenddate);
            // }}
            //
            ,{field: 'fResearchcycle', title: '研究周期',sort:false, sortname: 'f_researchcycle', hide: true,minWidth: '140'}
            ,{field: 'fDeptchargeperson', title: '单位负责人',sort:false, sortname: 'f_deptchargeperson', hide: true,minWidth: '150'}
            //
            // ,{field: 'fMainunitid', title: '主承担单位ID',sort:false, sortname: 'f_mainunitid'}
            ,{field: 'fTopicchargeperson', title: '课题负责人',sort:false, sortname: 'f_topicchargeperson', hide: true,minWidth: '150'}
            ,{field: 'fTelephonenumber', title: '联系电话',sort:false, sortname: 'f_telephonenumber', hide: true,minWidth: '140'}
            ,{field: 'fUniondept', title: '联合承担单位',sort:false, sortname: 'f_uniondept', hide: true,minWidth: '160'}
            ,{field: 'fItemapprovalnumber', title: '立项批复文号',sort:false, sortname: 'f_itemapprovalnumber', hide: true,minWidth: '160'}
            ,{field: 'fTaskapprovalnumber', title: '任务书批复文号',sort:false, sortname: 'f_taskapprovalnumber', hide: true,minWidth: '170'}

            ,{field: 'fNationalmoney', title: '国拨资金',sort:false, sortname: 'f_nationalmoney',  hide: true,minWidth: '140'}
            ,{field: 'fRaisemoney', title: '自筹资金',sort:false, sortname: 'f_raisemoney', hide: true,minWidth: '140'}
            ,{field: 'fIfcompleteaudit', title: '是否完成审计',sort:false, sortname: 'f_ifcompleteaudit', hide: true,minWidth: '160'}
            //如需转换为:yyyy-MM-dd HH:mm:ss: return publicMethods.timeData(d.fPlanauditdate,"1");
            //如需转换为HH:mm:ss: return publicMethods.timeData(d.fPlanauditdate,"2");
            // 当前转换后的格式为yyyy-MM-dd: return publicMethods.timeData(d.fPlanauditdate);
            ,{field: 'fPlanauditdate', title: '计划审计时间',sort:false, sortname: 'f_planauditdate',minWidth: '160',hide: true,templet: function (d) {
                return publicMethods.timeData(d.fPlanauditdate);
            }}
            //如需转换为:yyyy-MM-dd HH:mm:ss: return publicMethods.timeData(d.fActualauditdate,"1");
            //如需转换为HH:mm:ss: return publicMethods.timeData(d.fActualauditdate,"2");
            // 当前转换后的格式为yyyy-MM-dd: return publicMethods.timeData(d.fActualauditdate);
            ,{field: 'fActualauditdate', title: '审计实际完成时间',sort:false, sortname: 'f_actualauditdate',minWidth: '170', hide: true,templet: function (d) {
                return publicMethods.timeData(d.fActualauditdate);
            }}
            // ,{field: 'fObjectfield', title: '是否完成验收',sort:false, sortname: 'f_objectfield'}
            //如需转换为:yyyy-MM-dd HH:mm:ss: return publicMethods.timeData(d.fPlancheckdate,"1");
            //如需转换为HH:mm:ss: return publicMethods.timeData(d.fPlancheckdate,"2");
            // 当前转换后的格式为yyyy-MM-dd: return publicMethods.timeData(d.fPlancheckdate);
            ,{field: 'fPlancheckdate', title: '计划验收时间',sort:false, sortname: 'f_plancheckdate',minWidth: '160',hide: true,templet: function (d) {
                return publicMethods.timeData(d.fPlancheckdate);
            }}
            //如需转换为:yyyy-MM-dd HH:mm:ss: return publicMethods.timeData(d.fActualcheckdate,"1");
            //如需转换为HH:mm:ss: return publicMethods.timeData(d.fActualcheckdate,"2");
            // 当前转换后的格式为yyyy-MM-dd: return publicMethods.timeData(d.fActualcheckdate);
            ,{field: 'fActualcheckdate', title: '验收完成时间',sort:false, sortname: 'f_actualcheckdate',minWidth: '160', hide: true,templet: function (d) {
                return publicMethods.timeData(d.fActualcheckdate);
            }}
            ,{field: 'fMemo', title: '备注',sort:false, sortname: 'f_memo', hide: true,minWidth: '150'}
            ,{field: 'fKeytechnology', title: '突破关键技术',sort:false, sortname: 'f_keytechnology', hide: true,minWidth: '160'}
            ,{field: 'fPrototype', title: '原理样机',sort:false, sortname: 'f_prototype', hide: true,minWidth: '140'}
            ,{field: 'fSample', title: '材料样品',sort:false, sortname: 'f_sample', hide: true,minWidth: '140'}
            ,{field: 'fSamplenum', title: '样件',sort:false, sortname: 'f_samplenum', hide: true,minWidth: '140'}
            ,{field: 'fEquipment', title: '装备',sort:false, sortname: 'f_equipment', hide: true,minWidth: '140'}
            ,{field: 'fDemosystem', title: '集成验证或演示系统',sort:false, sortname: 'f_demosystem', hide: true,minWidth: '180'}
            ,{field: 'fDatabase', title: '数据库',sort:false, sortname: 'f_database', hide: true,minWidth: '140'}
            ,{field: 'fTechnicalstandard', title: '技术标准',sort:false, sortname: 'f_technicalstandard', hide: true,minWidth: '140'}
            ,{field: 'fProcessspecification', title: '工艺规范',sort:false, sortname: 'f_processspecification', hide: true,minWidth: '140'}
            ,{field: 'fApplicationpatent', title: '申请发明专利',sort:false, sortname: 'f_applicationpatent', hide: true,minWidth: '160'}
            ,{field: 'fAuthorizedpatent', title: '授权发明专利',sort:false, sortname: 'f_authorizedpatent', hide: true,minWidth: '160'}
            ,{field: 'fTrademark', title: '商标',sort:false, sortname: 'f_trademark', hide: true,minWidth: '140'}
            ,{field: 'fSoftware', title: '软件',sort:false, sortname: 'f_software', hide: true,minWidth: '140'}
            ,{field: 'fCopyright', title: '软件著作权',sort:false, sortname: 'f_copyright', hide: true,minWidth: '160'}
            ,{field: 'fPaper', title: '论文',sort:false, sortname: 'f_paper', hide: true,minWidth: '140'}
            ,{field: 'fMonograph', title: '专著',sort:false, sortname: 'f_monograph', hide: true,minWidth: '140'}
            ,{field: 'fGraduatestudent', title: '培养研究生',sort:false, sortname: 'f_graduatestudent', hide: true,minWidth: '160'}
            ,{field: 'fModelproducts', title: '应用型号产品',sort:false, sortname: 'f_modelproducts', hide: true,minWidth: '160'}
            ,{field: 'fReports', title: '国防科技工业科技报告',sort:false, sortname: 'f_reports', hide: true,minWidth: '190'}
            ,{field: 'fCheckdept', title: '组织验收部门',sort:false, sortname: 'f_checkdept', hide: true,minWidth: '160'}
            ,{field: 'fRatinglevel', title: '评定等级',sort:false, sortname: 'f_ratinglevel', hide: true,minWidth: '140'}
            ,{field: 'fPresidingexpert', title: '主审专家',sort:false, sortname: 'f_presidingexpert', hide: true,minWidth: '140'}
            ,{field: 'fAssessmentleader', title: '评审组组长',sort:false, sortname: 'f_assessmentleader', hide: true,minWidth: '150'}
            ,{field: 'fCheckapprovalnumber', title: '验收批复文号',sort:false, sortname: 'f_checkapprovalnumber', hide: true,minWidth: '160'}
            ,{field: 'fIfconclusion', title: '是否结题',sort:false, sortname: 'f_ifconclusion', hide: true,minWidth: '140'}
            ,{field: 'fNecessity', title: '必要性',sort:false, sortname: 'f_necessity', hide: true,minWidth: '140'}
            ,{field: 'fKeypoints', title: '对应的要点',sort:false, sortname: 'f_keypoints', hide: true,minWidth: '160'}
            ,{field: 'fTarget', title: '主要研究目标',sort:false, sortname: 'f_target', hide: true,minWidth: '160'}
            ,{field: 'fContent', title: '主要研究内容',sort:false, sortname: 'f_content', hide: true,minWidth: '160'}
            ,{field: 'fAchievements', title: '预期成果物',sort:false, sortname: 'f_achievements', hide: true,minWidth: '160'}
            ,{field: 'fMajorproblems', title: '针对解决的重大问题',sort:false, sortname: 'f_majorproblems', hide: true,minWidth: '190'}
            // ,{field: 'fRecommendation', title: '建议书',sort:false, sortname: 'f_recommendation', hide: true,minWidth: '140'}
            ,{field: 'fRecommendationpages', title: '建议书页数',sort:false, sortname: 'f_recommendationpages', hide: true,minWidth: '160'}
            // ,{field: 'fTaskbook', title: '任务书',sort:false, sortname: 'f_taskbook', hide: true,minWidth: '140'}
            // ,{field: 'fAcceptancereport', title: '验收报告',sort:false, sortname: 'f_acceptancereport', hide: true,minWidth: '140'}
            // ,{field: 'belongdeptname', title: '所属单位',sort:false, sortname: 'belongdeptname', hide: true,minWidth: '140'}
            ,{field: 'fIfadjustment', title: '是否调整',sort:false, sortname: 'f_ifadjustment', hide: true,minWidth: '140'}
            //如需转换为:yyyy-MM-dd HH:mm:ss: return publicMethods.timeData(d.createTime,"1");
            //如需转换为HH:mm:ss: return publicMethods.timeData(d.createTime,"2");
            // 当前转换后的格式为yyyy-MM-dd: return publicMethods.timeData(d.createTime);
            // ,{field: 'createTime', title: '创建时间',sort:false, sortname: 'createtime',templet: function (d) {
            //     return publicMethods.timeData(d.createTime);
            // }}
            // ,{field: 'createBy', title: '创建人',sort:false, sortname: 'createby'}
            //如需转换为:yyyy-MM-dd HH:mm:ss: return publicMethods.timeData(d.updateTime,"1");
            //如需转换为HH:mm:ss: return publicMethods.timeData(d.updateTime,"2");
            // 当前转换后的格式为yyyy-MM-dd: return publicMethods.timeData(d.updateTime);
            // ,{field: 'updateTime', title: '更新时间',sort:false, sortname: 'updatetime',templet: function (d) {
            //     return publicMethods.timeData(d.updateTime);
            // }}
            // ,{field: 'updateBy', title: '更新人',sort:false, sortname: 'updateby'}
            // ,{field: 'tenantId', title: '租户Id',sort:false, sortname: 'tenantid'}
            // ,{field: 'fReportStatusTemp', title: '三级单位上报状态',sort:false, sortname: 'f_report_status_temp'}
            //
            // ,{field: 'fReportReason', title: '失败原因',sort:false, sortname: 'f_report_reason'}
            // ,{field: 'fReturnmsg', title: '错误信息',sort:false, sortname: 'f_returnmsg'}
            // ,{field: 'fTechnology', title: '备用字段',sort:false, sortname: 'f_technology'}
        ];
        var diyCols = [];
        // if ("GROUPLEVEL" !== currentSystemLevel) {
        //     diyCols = [{field: 'fReportStatus', title: '上报状态',sort:false, sortname: 'f_report_status'}];
        // }
        if ("GROUPLEVEL" !== currentSystemLevel) {
            diyCols = [{field: 'reportStatusStr', minWidth: '200',title: '状态',sort:false, sortname: 'REPORT_STATUS',templet: function(d){
                return common.stateType(d);
            }}];
        }
        var manageCols =[{
            fixed: 'right',
            title: '管理',
            toolbar: '#wQbdTecBasicmanageRightToolsBar'
        }];
        var totalCols = [];
        totalCols = totalCols.concat(orderCols).concat(fillDeptCols).concat(commonCols).concat(hideCols).concat(diyCols).concat(manageCols);

        window.tableInstace = function(tcols) {
            if (tcols) {
                cols = tcols;
            }
            if (cols) {
                cols = JSON.parse(cols, function (k, v) {
                    if (v.indexOf && v.indexOf('function') > -1) {
                        return eval("(function(){return " + v + " })()")
                    }
                    return v;
                })
            }
            window.tableInstace.initCols = totalCols;
            //第一个实例
            window.tableInstace.tRender =  //第一个实例
                table.render({
                    elem: '#wQbdTecBasicmanageTable'
                    ,height:tableH
                    ,url: serverPath.qbdmsPath + '/qbdms/wQbdTecBasicmanage/list'
                    ,page: publicMethods.pageFun()
                    ,limit:20//开启分页
                    ,toolbar: '#wQbdTecBasicmanageHeaderToolsBar'
                    ,method: 'post'
                    ,defaultToolbar: ['']
                    ,autoSort: false //是否排序
                    ,cols: [cols?cols:window.tableInstace.initCols],done:function () {
                        common.tableSelectCon('.ccpui-enterSel .layui-form input','a[lay-event=query]','.ccpui-enterSel');
                    }
                    ,parseData: function(res){ //res 即为原始返回的数据
                        common.parseDataList(res,['fApprovedyear','fApprovalmoney','fMainunit','filldeptHospital','filldept','fRatinglevel']);
                        return {
                            "code": res.code, //解析接口状态
                            "msg": res.msg, //解析提示文本
                            "count": res.count, //解析数据长度
                            "data": res.data //解析数据列表
                        };
                    }
                });
        }

        window.tableInstace(cols);


        //list页面初始化展开按钮tips展示（展开按钮类名）
        publicMethods.tipsAuto('.screen')
        //筛选条件初始化（页面表格的Id，是否初始化（true、false））
        common.initScreenTop('wQbdTecBasicmanageTable',true);
        dateReflash()
        function dateReflash() {
            //年选择器
            laydate.render({
                elem: '#pfnd'
                , type: 'year'
                , trigger: 'click'
            });
        }
        function reflashQuery(isClear) {
            common.tableConditionRender("wQbdTecBasicmanageTable","wQbdTecBasicmanageQueryForm",{where:{}},isClear);
//            var originOrgList = eval('${originOrgList}'); //数据来源单位
//            debugger
//            common.initDicData("Q_filldeptid_S", originOrgList, "");
            setOrg();
        }
        setOrg();
        function review(datas){
            $.ajax({
                url: serverPath.qbdmsPath + '/qbdms/wQbdTecTopicreview/list?fTopicnameid='+ datas +'&mark=review',
                type: "post",
                dataType:'json',
                success: function (data) {
                    var layerH=publicMethods.layHeight('.listBody');
                    if(data.data.length > 0){
                        layer.open({
                            type: 2,
                            area: ['80%', layerH],
                            title: ['评审会'],
                            // btn: ['关闭'] ,
                            content: serverPath.qbdmsPath + '/qbdms/wQbdTecBasicmanage/view/review?did=' + datas +'&mark=review'
                        });
                    } else {
                        layer.alert(publicMethods.confirmStyle("暂无评审会信息"),{title: false,skin: 'confirm-class'});
                        // layer.open({
                        //     title: '提示'
                        //     ,content: '暂无评审会信息'
                        // });
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    // console.log(XMLHttpRequest);
                    // console.log(textStatus);
                }
            })

        }

        table.on('toolbar(wQbdTecBasicmanageTable)', function (obj) {
            var checkStatus = table.checkStatus(obj.config.id);
            var data = checkStatus.data;
            var _this = this;
            var layerH=publicMethods.layHeight('.listBody');
            switch (obj.event) {
                case 'add':
                    window.location.href = serverPath.qbdmsPath + "/qbdms/wQbdTecBasicmanage/view/add";
                    break;
                case 'delete':
                    var array = "";
                    for (var i = 0; i < data.length; i++) {
                        array+=data[i].id+",";
                    }
                    delFun(data,array);

                    break;
                case 'export':
                    function open(url , param){
                        var curUrl = url;
                        layer.open({
                            type: 2,
                            area: ['700px', '520px'],
                            title: ['自定义导出', 'font-size:14px;'],
                            content: __ctx + '/qbdms/wQbdTecBasicmanage/view/export',
                            btnAlign: 'c',
                            skin: 'qbdms-layerFormBtn',
                            btn: ['确定', '取消'],
                            yes: function(index, layero){
                                url = curUrl;
                                var iframeWin = window["layui-layer-iframe" + index];
                                var data = iframeWin.getData();
                                if(data){
                                    url = url + "?data=" + JSON.stringify(data) + param;
                                    window.location.href = encodeURI(url)
                                }
                            }
                        });
                    }


                    if (data.length == 0) {
                        layer.confirm(publicMethods.confirmStyle('还没有选择，是否导出全部?'),{title: false,skin: 'confirm-class'}, function (index) {
                            layer.close(index);
                            var url = __ctx + '/qbdms/wQbdTecBasicmanage/exportData';
                            var param = "";
                            $("form[lay-filter='wQbdTecBasicmanageQueryForm']").find(".filter-value").each(function(i,value) {
                                param += "&"+this.name+"="+this.value
                            });
                            open(url , param);
                        });
                    } else {
                        layer.confirm(publicMethods.confirmStyle('确定导出吗?'),{title: false,skin: 'confirm-class'}, function (index) {
                            layer.close(index);
                            var ids = [];
                            for (var i = 0; i < data.length; i++) {
                                ids.push(data[i].id);
                            }
                            var url = serverPath.qbdmsPath + '/qbdms/wQbdTecBasicmanage/exportData';
                            open(url , "&id="+ids);
                        });
                    }
                    break;
                case "import":
                    common.importInit('wQbdTecBasicmanageTable',"/qbdms/wQbdTecBasicmanage/importData",true,"/importTemplates/课题信息.xlsx");
                    dateReflash();
                    break;
                case "query":
                    reflashQuery(false);
                    dateReflash();
                    break;
                case "clears":
                    reflashQuery(true);
                    dateReflash();
                    form.render();
                    break;
                case "screen":
                    common.initScreenTop('wQbdTecBasicmanageTable');
                    dateReflash();
                    form.render();
                    break;
                case "report":
                    var array = "";
                    for (var i = 0; i < data.length; i++) {
                        array+=data[i].id+",";
                    }
                    //业务表名,勾选数据主键,流程key,table标签lay-filter属性值,form标签lay-filter属性值,是否允许重复上报,页面所在包名,流程定义id
                    common.report("w_qbd_tec_basicmanage",array,"plantToHospital","wQbdTecBasicmanageTable","wQbdTecBasicmanageQueryForm",true,"wQbdTecBasicmanage","plantToHospital:1:72d05d40362249118c5453aa60c6da90");
                    dateReflash();
                    break;
                case "listStyle":
                    layer.open({
                        type: 2,
                        area: ['80%', layerH],
                        skin: 'qbdms-layerFormBtn',
                        title: ['新增列表样式', 'font-size:14px;'],
                        content: __ctx + '/qbdms/wCustomColumns/view/list',
                        success:function (layero, index) {
                            publicMethods.tipsAuto(layero.find('.layui-layer-setwin'),'点击这里关闭弹框哦',2000)
                        }
                    });
                    break;

            };
        });

        table.on('tool(wQbdTecBasicmanageTable)', function(obj) {
            var data = obj.data, //获得当前行数据
                layEvent = obj.event; //获得 lay-event 对应的值
            switch(layEvent){
                case "edit":
                    window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdTecBasicmanage/view/add?id='+data.id
                    break;
                case "particulars":
                    window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdTecBasicmanage/view/particulars?id='+data.id;
                    break;
                case "psh":
                    review(data.id);
                    break;
                case "del":
                    delFun(data,data.id);
                    break;
            }
        });

        function delFun(data,id) {
            if (data.length === 0) {
                layer.confirm(publicMethods.confirmStyle("请先选择一行数据!"),{title: false,skin: 'confirm-class'});
            } else {
                layer.confirm(publicMethods.confirmStyle('确定删除当前数据吗?'),{title: false,skin: 'confirm-class'},function (index) {
                    layer.close(index);
                    $.ajax({
                        url: serverPath.qbdmsPath + "/qbdms/wQbdTecBasicmanage/del",
                        type: "post",
                        data: {id:id},
                        dataType: 'json',
                        success: function (data) {
                            layer.confirm(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
                            //执行重载
                            reflashQuery(true);
                            dateReflash();
                        },
                        error: function (XMLHttpRequest, textStatus, errorThrown) {
                            layer.confirm(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
                            //执行重载
                            reflashQuery(true);
                            dateReflash();
                        }
                    })
                })
            }
        }

        window.Initialization = function () {
            dateReflash();
            reflashQuery(true);
        };
        /*刷新时间控件*/
        dateReflash();
        common.tableSort("wQbdTecBasicmanageTable",{show:window.Initialization});

        function setOrg() {
            var org = eval('${org}');
            var orgHtml = "<option value=\"\"></option>";
            $.each(org, function (index, obj) {
                orgHtml += "  <option  orgid='" + obj.CODE + "' value='" + obj.CODE + "'  >" + obj.ORGNAME + "</option>";
            });
            $("select[name='Q_fMainunitid_S']").html(orgHtml);
        }

        table.on('sort()', function(obj){
            reflashQuery(false);
            dateReflash();
            setOrg();
        });

        form.render();
    });
</script>
</body>
</html>